package com.xatz.scanner

import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import timber.log.Timber

class HomeKeyEventReceiver: BroadcastReceiver() {
    override fun onReceive(p0: Context?, p1: Intent?) {
        when(p1?.action){
            Intent.ACTION_CLOSE_SYSTEM_DIALOGS -> {
                val reason = p1?.getStringExtra("reason")
                if(reason == "homekey"){
                    Timber.e("表示按了home键,程序到了后台")
                }
                Timber.e(reason)
            }
        }
    }
}